<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Notepad</title>

    <!-- bootstrap -->
    <link rel="stylesheet" href="./assets/css/bootstrap.min.css" />

    <!-- muiUI -->
    <link rel="stylesheet" href="./assets/plugins/mui/css/mui.min.css">

    <!-- animate.css -->
    <link rel="stylesheet" href="./assets/css/animate.min.css" />

    <!-- 重置样式 -->
    <link rel="stylesheet" href="./assets/css/reset.css" />

    <!-- 公共样式 -->
    <link rel="stylesheet" href="./assets/css/common.css" />

    <!-- 页面独立的 -->
    <link rel="stylesheet" href="./assets/css/UserIndex.css" />
</head>

<body>
    <!-- 用户信息 -->
    <div class="user">
        <div class="avatar wow fadeInUp">
            <img src="./assets/images/avatar.png" />
        </div>

        <div class="nickname wow fadeInUp" data-wow-delay="100ms">FunkyRicky</div>

        <a href="login.html" class="login wow fadeInUp" data-wow-delay="200ms">登录</a>
    </div>

    <!-- 菜单 -->
    <div class="menulist wow fadeInUp" data-wow-delay="300ms">
        <a href="UserProfile.html" class="item">
            <span>基本资料</span>
            <img src='./assets/images/row.png' />
        </a>
        <a href="type.html" class="item">
            <span>卡片分类</span>
            <img src='./assets/images/row.png' />
        </a>
        <!-- 退出登录按钮 -->
        <a href="javascript:void(0)" class="item logout">
            <span>退出登录</span>
            <img src='./assets/images/row.png' />
        </a>
    </div>


    <!-- 底部 -->
    <div class="tabbar">
        <div class="box">
            <a href="index.html" class="item">
                <span class="icon glyphicon glyphicon-home"></span>
                <span class="name">首页</span>
            </a>
            <a href="ContactAdd.html" class="item">
                <span class="icon glyphicon glyphicon-list-alt"></span>
                <span class="name">新建</span>
            </a>
            <a href="UserIndex.html" class="item">
                <span class="icon glyphicon glyphicon-user"></span>
                <span class="name">我的</span>
            </a>
        </div>
    </div>
</body>

</html>
<!-- jquery  -->
<script src="./assets/js/jquery.min.js"></script>

<!-- bootstrap -->
<script src="./assets/js/bootstrap.min.js"></script>

<!-- wow.js -->
<script src="./assets/js/wow.min.js"></script>

<!-- 引入cookie封装文件 -->
<script src="./assets/plugins/cookie.js"></script>

<!-- 引入mui.js 文件 -->
<script src="./assets/plugins/mui/js/mui.min.js"></script>

<!-- 引入axios这个插件文件 -->
<script src="./assets/plugins/axios/axios.min.js"></script>

<!-- 自己封装请求函数 里面 GET POST UPLOAD文件请求 -->
<script src="./assets/plugins/axios/request.js"></script>

<!-- 引入登录判断的文件 -->
<script src="./assets/plugins/login.js"></script>
<script>
    //实例化wow.js
    new WOW().init()

    var business = cookie.get('business') ? JSON.parse(cookie.get('business')) : {};

    // 判断一个对象是否为空，只要看对象中有没有属性，没有属性就说明是空对象
    //说明对象中有属性，不为空
    if (Object.getOwnPropertyNames(business).length > 0) {
        $(".nickname").text(business.nickname)
        $(".avatar img").attr('src', business.avatar)
        $(".login").css('display', 'none')
    }

    $('.logout').click(function () {
        //弹出一个确认对话框
        mui.confirm('是否确认退出登录', '退出提醒', ['确认', '取消'], function (res) {
            //点击了确认按钮
            if (res.index == 0) {
                //删除cookie信息
                cookie.clear()

                location.href = 'login.html'
                return false
            }
        })
    })

</script>